package com.crungoo;

import com.crungoo.service.OrderService;
import com.crungoo.service.UserService;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class App {

    public static void main(String[] args) {

        // 构建一个Bean工厂，也就是我们常说的Spring的IOC容器
        // 1、扫描
        // 2、初始化非懒加载的单例bean
        AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(AppConfig.class);
        UserService userService = (UserService) applicationContext.getBean("userService1");
        userService.test();

    }
}
